<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var num = 105;
    var num2 = 10.5;



    num = 0x11;   //十六进制
    num = 0b11;   // 二进制
    num = 0o11;   //八进制

    console.log(num);
    console.log(typeof num);

    var a = 0.1+0.2;
    a = a.toFixed(2);
    console.log(a);
    var c = 8;
    console.log(c.toString(8));



    //NaN Not a Number 不是一个数字

    var r = isNaN("aaaa");
    console.log(r);

    //其它类型数据转换成 数字
    var aa = "x123";
    console.log(typeof aa);
    r = parseInt(aa);
    console.log(typeof r);
    console.log(r);

</script>
</body>
</html>